#ifndef STATECHANGES_H
#define STATECHANGES_H

#include "states.h"




// a change in the current turn
struct TurnChange : public StateChange
{
	Turn oldturn, newturn;

	std::function<PlayerInfo& ()> infoLookup;

	DECLARE_STATE_CHANGE("$TurnChange")
};

// a change in the name of a player, or the visibility of that name
struct PlayerNameChange : public StateChange
{
	std::string oldname, newname;
	PlayerMask oldmask, newmask;

	std::function<PlayerInfo& ()> infoLookup;

	DECLARE_STATE_CHANGE("$PlayerNameChange")
};

// a change in the visibility, terrain, or impassibility of a map tile
struct TileChange : public StateChange
{
	int idx;  // index into the tile-data vectors
	int oldterrain, newterrain;
	bool oldimpassible, newimpassible;
	PlayerMask oldvisibility, newvisibility;

	std::function<Map& ()> mapLookup;

	DECLARE_STATE_CHANGE("$TileChange")
};

// a change in a camper's vision attribute, or the visibility of that attribute
struct VisionChange : public StateChange
{
	int oldvision, newvision;
	PlayerMask oldmask, newmask;

	std::function<CamperAttributes& ()> attrLookup;

	DECLARE_STATE_CHANGE("$VisionChange")
};

// a change in a camper's strength attribute, or the visibility of that attribute
struct StrengthChange : public StateChange
{
	int oldstrength, newstrength;
	PlayerMask oldmask, newmask;

	std::function<CamperAttributes& ()> attrLookup;

	DECLARE_STATE_CHANGE("$StrengthChange")
};

// a change in a camper's speed attribute, or the visibility of that attribute
struct SpeedChange : public StateChange
{
	int oldspeed, newspeed;
	PlayerMask oldmask, newmask;

	std::function<CamperAttributes& ()> attrLookup;

	DECLARE_STATE_CHANGE("$SpeedChange")
};

// a camper movement and/or change in visibility
struct CamperPosChange : public StateChange
{
	GridPos oldpos, newpos;
	bool oldjailed, newjailed;
	PlayerMask oldmask, newmask;

	std::function<CamperStatus& ()> statusLookup;

	DECLARE_STATE_CHANGE("$CamperPosChange")
};

// a change in camper movement points or visibility thereof
struct MovementPtsChange : public StateChange
{
	int oldpts, newpts;
	PlayerMask oldmask, newmask;

	std::function<CamperStatus& ()> statusLookup;

	DECLARE_STATE_CHANGE("$MovementPtsChange")
};


#endif // STATECHANGES_H